package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.StbEmployeeMapper;
import com.ruoyi.system.domain.StbEmployee;
import com.ruoyi.system.service.IStbEmployeeService;
import com.ruoyi.common.core.text.Convert;

/**
 * 员工Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-02-08
 */
@Service
public class StbEmployeeServiceImpl implements IStbEmployeeService 
{
    @Autowired
    private StbEmployeeMapper stbEmployeeMapper;

    /**
     * 查询员工
     * 
     * @param empId 员工ID
     * @return 员工
     */
    @Override
    public StbEmployee selectStbEmployeeById(Long empId)
    {
        return stbEmployeeMapper.selectStbEmployeeById(empId);
    }

    /**
     * 查询员工列表
     * 
     * @param stbEmployee 员工
     * @return 员工
     */
    @Override
    public List<StbEmployee> selectStbEmployeeList(StbEmployee stbEmployee)
    {
        return stbEmployeeMapper.selectStbEmployeeList(stbEmployee);
    }

    
    /**
     * 新增员工
     * 
     * @param stbEmployee 员工
     * @return 结果
     */
    @Override
    public int insertStbEmployee(StbEmployee stbEmployee)
    {
        stbEmployee.setCreateTime(DateUtils.getNowDate());
        return stbEmployeeMapper.insertStbEmployee(stbEmployee);
    }

    /**
     * 修改员工
     * 
     * @param stbEmployee 员工
     * @return 结果
     */
    @Override
    public int updateStbEmployee(StbEmployee stbEmployee)
    {
        stbEmployee.setUpdateTime(DateUtils.getNowDate());
        return stbEmployeeMapper.updateStbEmployee(stbEmployee);
    }

    /**
     * 删除员工对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteStbEmployeeByIds(String ids)
    {
        return stbEmployeeMapper.deleteStbEmployeeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除员工信息
     * 
     * @param empId 员工ID
     * @return 结果
     */
    @Override
    public int deleteStbEmployeeById(Long empId)
    {
        return stbEmployeeMapper.deleteStbEmployeeById(empId);
    }

	@Override
	public List<Map<String, Object>> selectEmpTabsCount(StbEmployee stbEmployee) {
		
        return stbEmployeeMapper.selectEmpTabsCount(stbEmployee);

	}

	@Override
	public List<Map<String, Object>> selectIsTalent(StbEmployee stbEmployee) {
		return stbEmployeeMapper.selectIsTalent(stbEmployee);
	}


}
